﻿using System;
using System.Collections.Generic;
using System.Text;
using Twitter;

namespace ConsoleTest
{
    class Program
    {
        static void Main(string[] args)
        {
            Twitter.Twitter twitter = Twitter.Twitter.GetInstance();

            twitter.Login("pk4vs", "procrastination");
            twitter.OnTweetPosted += new EventHandler<TwitterEventArgs>(twitter_OnTweetPosted);


            twitter.PostTweetAsync("Lots of problems...");

            twitter.OnGetTweets += new EventHandler<TwitterEventArgs>(twitter_OnGetTweets);
            twitter.GetTweetsAsync();

          

            Console.ReadKey();
        }

        static void twitter_OnGetTweets(object sender, TwitterEventArgs e)
        {
            if (e != null)
                foreach (Tweet tweet in e.Tweets)
                {
                    Console.WriteLine("-" + tweet);
                }

        }

        static void twitter_OnTweetPosted(object sender, TwitterEventArgs e)
        {
            if (e != null)
                Console.WriteLine(e.Tweets[0]);

        }
    }
}
